package com.itheima.feign;

import com.itheima.domain.db.*;
import com.itheima.feign.config.FeignConfig;
import com.itheima.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="db-service", configuration = FeignConfig.class)
public interface DbServiceFeign {

    @GetMapping("/admin/findByUsername")
    Admin findByUsername(@RequestParam("username") String username);

    @GetMapping("/analysisByDay/analysis")
    void analysis();

    @GetMapping("/analysisByDay/summary")
    AnalysisSummaryVo summary();

    @GetMapping("/analysisByDay/summaryTable")
    AnalysisTableVo summaryTable(@RequestParam("sd")Long sd,@RequestParam("ed")Long ed,@RequestParam("type")String type);

    @GetMapping("/announcement/findAnnouncementList")
    PageBeanVo findAnnouncementList(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize")Integer pageSize);

    @GetMapping("/blackList/findBlackUserByUserId")
    PageBeanVo findBlackUserByUserId(@RequestParam("userId")Long userId,@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize);

    @DeleteMapping("/blackList/deleteBlackUser")
     void deleteBlackUser(@RequestParam("userId")Long userId, @RequestParam("blackUserId")Integer blackUserId);

    @GetMapping("/freeze/findFreezeByUserId")
    Freeze findFreezeByUserId(@RequestParam("userId") Integer userId) ;

    @PostMapping("/freeze/saveFreeze")
    void saveFreeze(@RequestBody Freeze freeze1);

    @PutMapping("/freeze/updateFreeze")
    void updateFreeze(@RequestBody Freeze freeze) ;

    @PutMapping("/freeze/update")
    void update(@RequestParam("reasonsForThawing") String reasonsForThawing, @RequestParam("userId") Integer userId);

    @PostMapping("/log/save")
    void save(@RequestBody Log log);

    @GetMapping("/notification/findByUserId")
    Notification findByUserId(@RequestParam("userId") Long userId);

    @PostMapping("/notification/save")
    void save(@RequestBody Notification notification);

    @PutMapping("/notification/update")
    void update(@RequestBody Notification notification);

    @GetMapping("/question/findByUserId")
    Question findByUserIdQ(@RequestParam("userId") Long userId);

    @PostMapping("/question/save")
    void save(@RequestBody Question question);

    @PutMapping("/question/update")
    void update(@RequestBody Question question);

    @PostMapping("/user/save")
    Long save(@RequestBody User user);

    @GetMapping("/user/findByPhone")
    User findByPhone(@RequestParam("phone") String phone);

    @GetMapping("/user/findUserById")
    User findUserById(@RequestParam("userId") Long userId);

    @PutMapping("/user/updatePhone")
    void updatePhone(@RequestParam("phone") String phone,@RequestParam("id") Long id);

    @PostMapping("/userInfo/save")
    void save(@RequestBody UserInfo userInfo);

    @PutMapping("/userInfo/update")
    void update(@RequestBody UserInfo userInfo);

    @GetMapping("/userInfo/findById")
    UserInfo findById(@RequestParam("id") Long id);

    @GetMapping("/userInfo/findUserList")
    PageBeanVo findUserList(@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize") Integer pageSize);
    @GetMapping("/testsoul/findAll")
    List<TopicVo> findAllTestSoul();
    @PostMapping("/testsoul")
    Integer TopicAnswer(@RequestBody AnswersVo answers);
    @GetMapping("/testsoul/report/{id}")
    ReportVo report(@PathVariable("id") Long id);
}